# 导入selenium 包
from selenium import webdriver
# 导入定位类
from selenium.webdriver.common.by import By
from time import sleep
# 获取浏览器驱动驱动
driver = webdriver.Firefox()
# 打开测试的网页
url = 'file:///D:/nsd2404/html/registerA.html'
driver.get(url)
# 定位到账号A文本框，输入用户名
# 通过ID定位方式
username = driver.find_element(By.ID, 'userA')
# 输入一个值
username.send_keys('admin')
# 练习：使用ID定位方式，分别输入密码、电话、邮箱，并输入对应的值
password = driver.find_element(By.ID, 'passwordA')
password.send_keys('123456')
tel = driver.find_element(By.ID, 'telA')
tel.send_keys('18912348981')
email = driver.find_element(By.ID, 'emailA')
email.send_keys('123@qq.com')

# 停顿3秒钟，关闭驱动
sleep(3)
driver.quit()